package com.einmeer.hfbank.controller;

import com.einmeer.hfbank.service.BankService;
import com.einmeer.hfbank.vo.ResultVo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author 芊嵛
 * @date 2024/1/12
 */

@RestController
@RequestMapping("/bank")
public class BankController {
    @Resource
    private BankService bankService;

    /**
     * 根据bankId查询银行名字
     * @param bankId
     * @return
     */
    @GetMapping("/info/{bankId}")
    @CrossOrigin
    public ResultVo info(@PathVariable("bankId") Integer bankId){
        return bankService.queryBankInfo(bankId);
    }

    @GetMapping("/queryAllBanks")
    @CrossOrigin
    public ResultVo queryAllBanks(){
        return bankService.queryAllBanks();
    }

}
